package fun._6742.model.valueobject;

import fun._6742.model.dataobject.ProductDO;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;

@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class ProductVO {
    private Long id;

    /**
     * 标题
     */
    private String title;

    /**
     * 封面图
     */
    private String coverImg;

    /**
     * 详情
     */
    private String detail;

    /**
     * 老价格
     */
    private BigDecimal oldPrice;

    /**
     * 新价格
     */
    private BigDecimal price;

    /**
     * 库存
     */
    private Integer stock;

    /**
     * 类别
     */
    private Long category;

    /**
     * 品牌
     */
    private String brand;

    public ProductVO(ProductDO productDO){
        this.id = productDO.getId();
        this.title = productDO.getTitle();
        this.coverImg = productDO.getCoverImg();
        this.detail = productDO.getDetail();
        this.oldPrice = productDO.getOldPrice();
        this.price = productDO.getPrice();
        this.stock = productDO.getStock();
        this.category = productDO.getCategory();
        this.brand = productDO.getBrand();
    }

}
